<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:ice="http://www.icesoft.com/icefaces/component" 
      xmlns:icecore="http://www.icefaces.org/icefaces/core">
    <h:head>
        <title>Facelet Title</title>
    </h:head>
    <h:body>
        <ui:composition template="template/common/template.xhtml">
       
            <ui:define name="content">
                <ice:outputStyle href="/xmlhttp/css/xp/xp.css"/>
                <style>
                    .goodId {
                        width: 25px;
                    }
                    .goodName {
                        width: 250px;
                    }
                    .goodPrice {
                        width: 75px;
                    }
                    .goodCount {
                        width: 25px;
                    }
                    .goodEdit {
                        width: 50px;
                    }
                </style>
                <ice:form id="listForm">
                    <ice:dataTable 
                        id="priceListTable" rows="5"
                        value="#{sessionBean.priceList}" var="item"
                        sortColumn="#{sessionBean.sortColumnName}"
                        sortAscending="#{sessionBean.ascending}"
                        columnClasses="goodId, goodName, goodPrice, goodCount, goodEdit"
                        >
                        <ice:column>
                            <f:facet name="header">
                                <ice:commandSortHeader columnName="ID"
                                    arrow="true" >ID
                                </ice:commandSortHeader>
                            </f:facet>
                            #{item.id}
                        </ice:column>
                        <ice:column>
                            <f:facet name="header">
                                <ice:commandSortHeader columnName="Name"
                                    arrow="true" >Name
                                </ice:commandSortHeader>
                            </f:facet>
                            #{item.name}
                        </ice:column>
                        <ice:column>
                            <f:facet name="header">
                                <ice:commandSortHeader columnName="Price"
                                    arrow="true" >Price
                                </ice:commandSortHeader>
                            </f:facet>
                            #{item.price}
                        </ice:column>
                        <ice:column>
                             <f:facet name="header">
                                <ice:commandSortHeader columnName="Count"
                                    arrow="true" >Count
                                </ice:commandSortHeader>
                            </f:facet>
                            #{item.count}
                        </ice:column>
                        <ice:column>
                            <f:facet name="header"></f:facet>
                            <h:commandLink action="#{sessionBean.setCurrentItem}">Edit
                                <f:param name="id" value="#{item.id}"></f:param>
                            </h:commandLink>
                        </ice:column>
                    
                    </ice:dataTable>
                    <ice:dataPaginator id="pricePaginator"
                       for="priceListTable"
                       paginator="true"
                       fastStep="3"
                       paginatorMaxPages="4"
                       >
                        <f:facet name="first">
                            <ice:graphicImage 
                                url="/xmlhttp/css/xp/css-images/arrow-first.gif" 
                                style="border:none;" title="First Page"></ice:graphicImage>
                        </f:facet>
                        <f:facet name="last">
                            <ice:graphicImage 
                                url="/xmlhttp/css/xp/css-images/arrow-last.gif" 
                                style="border:none;" title="Last Page">
                            </ice:graphicImage>
                        </f:facet>
                        <f:facet name="previous">
                            <ice:graphicImage 
                                url="/xmlhttp/css/xp/css-images/arrow-previous.gif" 
                                style="border:none;" title="Previous Page">
                            </ice:graphicImage>
                        </f:facet>
                        <f:facet name="next">
                            <ice:graphicImage 
                                url="/xmlhttp/css/xp/css-images/arrow-next.gif" 
                                style="border:none;" title="Next Page">
                            </ice:graphicImage>
                        </f:facet>
                        <f:facet name="fastforward">
                            <ice:graphicImage 
                                url="/xmlhttp/css/xp/css-images/arrow-ff.gif" 
                                style="border:none;" title="Fast Forward">
                            </ice:graphicImage>
                        </f:facet>
                        <f:facet name="fastrewind">
                            <ice:graphicImage 
                                url="/xmlhttp/css/xp/css-images/arrow-fr.gif" 
                                style="border:none;" title="Fast Backwards">
                            </ice:graphicImage>
                        </f:facet>
                    </ice:dataPaginator>
                </ice:form>
                
                <ui:include src="popup.xhtml"/>
                
            </ui:define>
            
        </ui:composition>
    </h:body>
</html>

